home *** CD-ROM | disk | FTP | other *** search
/ OpenGL Superbible (2nd Edition) / OpenGL SuperBible e2.iso / tools / GLUT-3.7 / PROGS / DEMOS / YACME / mallocbis.h < prev    next >
Encoding:
C/C++ Source or Header  |  1998-08-12  |  212 b   |  14 lines

  1.  
  2. #define newItem(item,list,type)\
  3.     if (list == NULL)\
  4.         item = (type *) malloc(sizeof(type));\
  5.     else\
  6.     {\
  7.         item = list;\
  8.         list = list->next;\
  9.     }
  10.  
  11. #define freeItem(item,list)\
  12.     item->next = list;\
  13.     list = item;
  14.